home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / maximus / stview10.zip / STARVIEW.MH < prev    next >
Text File  |  1996-04-21  |  3KB  |  110 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // StarView Include File (!)1996 Larry Monte/StarLab Systems Software
  4. //
  5. //
  6.  
  7. ///////////////////////Terminology Explanations/////////////////////////////
  8. //
  9. // About un-commenting/commenting-out:
  10. // -----------------------------------
  11. //
  12. // When talking about commenting-out, it refers to disabling one of the
  13. // #defines below.
  14. // To comment out a #define, simply place "//" (without quotes) before
  15. // the #define.
  16. // To un-comment, remove the "//"'s (without quotes) which appear before
  17. // the #define.
  18. //
  19. ////////////////////////////////////////////////////////////////////////////
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. //
  23. // Change the following to reflect the path where you put your STARVIEW files
  24. // Be sure to use double "\\"'s and include the trailing "\\"'s
  25.  
  26. #define STARVIEW_PATH      "C:\\MAX\\STARVIEW\\"
  27.  
  28. ////////////////////////////////////////////////////////////////////////////
  29. // One of the following 2 defines must be uncommented. It determines the
  30. // type of operating system you are using. WIN95 users should define DOS..
  31. // Default is DOS
  32.  
  33. #define DOS
  34. // #define OS2
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. //
  38. // Leave these 2 defines alone....
  39.  
  40. #define FF_OFFLINE         0x02
  41. #define this_task          uitostr(id.task_num)
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. //
  45. // The following works in conjunction with the do_spec function. This #define
  46. // determines how many file specs will be searched within the archive. This
  47. // defines how many file specs will be searched for. (Default is 4: *.DOC,
  48. // *.TXT, *.PRN, and *.LST)
  49. // To define more, add one to the #define FILE_SPECS, below, and add the
  50. // specs[#] as instructed below.
  51.  
  52. #define FILE_SPECS         5
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. //
  56. // Leave this line alone...
  57.  
  58. array [1..FILE_SPECS] of string: specs;
  59.  
  60. /////////////////////////////////////////////////////////////////////////////
  61. //
  62. // Function for searching file specs...
  63.  
  64. int do_spec(string: fname)
  65. {
  66.   int: i;
  67.  
  68. /////////////////////////////////////////////////////////////////////////////
  69. //
  70. // To add more file specs, define them here (see example below)
  71. // NOTE: You do not need to worry about READ.ME files as they are searched
  72. //       for by default!
  73. //
  74.   specs[1] := ".DOC";
  75.   specs[2] := ".TXT";
  76.   specs[3] := ".PRN";
  77.   specs[4] := ".LST";
  78.   specs[5] := ".DIZ";
  79.  
  80. // Example:
  81. //
  82. // specs[6] := ".EXM";
  83. //
  84. // By setting FILE_SPECS above to 5, you can then add the above statement to
  85. // search the archive for *.EXM files to be viewed online.
  86.  
  87.  
  88.   for(i:=FILE_SPECS;i>0;i:=i-1)
  89.   {
  90.     if(strfind(fname,specs[i]) OR (strfind(fname,"READ") AND
  91.        strfind(fname,"ME")))
  92.       return 1;
  93.  
  94.   }
  95.   return 0;
  96. }
  97.  
  98. string longpadleft(long: i, int: len, int: ch)
  99. {
  100.         string: itos;
  101.         string: rc;
  102.  
  103.         itos:=ltostr(i);
  104.  
  105.         rc:=strpad("", len - strlen(itos), ch);
  106.  
  107.         return rc + itos;
  108. }
  109.  
  110.